tools/ocaml/xb,mmap: Use Data_abstract_val wrapper
authorEdwin Török <edvin.torok@citrix.com>
Fri, 16 Dec 2022 18:25:10 +0000 (18:25 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 9 Feb 2023 15:55:25 +0000 (15:55 +0000)
commit7d516fc87637dc551494f8eca08f106f578f7112
tree91d79b24495b31a405945bc5a877d1cd73350269
parent5d8f9cfa166c55a308856e7b021d778350edbd6c
tools/ocaml/xb,mmap: Use Data_abstract_val wrapper

This is not strictly necessary since it is essentially a no-op currently: a
cast to void * and value *, even in OCaml 5.0.

However it does make it clearer that what we have here is not a regular OCaml
value, but one allocated with Abstract_tag or Custom_tag, and follows the
example from the manual more closely:
https://v2.ocaml.org/manual/intfc.html#ss:c-outside-head

It also makes it clearer that these modules have been reviewed for
compat with OCaml 5.0.

We cannot use OCaml finalizers here, because we want exact control over when
to unmap these pages from remote domains.

No functional change.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
(cherry picked from commit d2ccc637111d6dbcf808aaffeec7a46f0b1e1c81)
tools/ocaml/libs/mmap/mmap_stubs.h
tools/ocaml/libs/mmap/xenmmap_stubs.c
tools/ocaml/libs/xb/xs_ring_stubs.c